<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        /**
         *  一个Promise对象，可以指定多个成功失败的回调，并且都可以执行
         * 
         */
        const p1 = new Promise((resolve,reject)=>{
            // resolve('ok')
            reject('error');
        })

        p1.then(value=>{
            console.log('成功回调1', value);
        },reason=>{
            console.log('失败回调1', reason);
        })

        p1.then(value=>{
            console.log('成功回调2', value);
        },reason=>{
            console.log('失败回调2', reason);
        })
    </script>
</body>
</html>